package com.srlg.liteflow.controller;

import com.srlg.liteflow.model.dto.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * test 控制器
 */
@RestController
@RequestMapping("api")
public class TestController {

    /**
     * 用id查询用户
     *
     * @param id 主键
     * @return User
     */
    @GetMapping("query/{id}")
    public User query(@PathVariable Long id) {

        User user = new User();
        user.setId(id);
        user.setName("srlg li");
        user.setAge(98);

        return user;
    }
}
